const KoaRouter = require('@koa/router')
const { verifyAuth } = require('../middleware/login.middleware')
const { handleUploadSingle } = require('../middleware/file.middleware')
const { create } = require('../controller/file.controller')

// 1.定义路由对象
const fileRouter = new KoaRouter({ prefix: "/file" })

// 2.具体路由规则
// 头像上传（单文件上传）
fileRouter.post('/avatar', verifyAuth , handleUploadSingle, create)

module.exports = fileRouter